package com.huawei.hwid.core.datatype;

import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import com.huawei.hwid.core.d.b;
import com.huawei.hwid.core.d.b.e;
import java.io.IOException;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

public class TmemberRight implements Parcelable {
    public static final Creator<TmemberRight> CREATOR = new Creator<TmemberRight>() {
        public /* synthetic */ Object createFromParcel(Parcel parcel) {
            return a(parcel);
        }

        public /* synthetic */ Object[] newArray(int i) {
            return a(i);
        }

        public TmemberRight a(Parcel parcel) {
            TmemberRight tmemberRight = new TmemberRight();
            tmemberRight.a = parcel.readLong();
            tmemberRight.b = parcel.readInt();
            tmemberRight.c = parcel.readString();
            tmemberRight.d = parcel.readString();
            tmemberRight.e = parcel.readString();
            tmemberRight.f = parcel.readInt();
            tmemberRight.g = parcel.readString();
            tmemberRight.h = parcel.readString();
            return tmemberRight;
        }

        public TmemberRight[] a(int i) {
            return new TmemberRight[i];
        }
    };
    public static final String TAG_DEVICEID = "deviceId";
    public static final String TAG_DEVICEID2 = "deviceID2";
    public static final String TAG_DEVICETYPE = "deviceType";
    public static final String TAG_EXPIREDDATE = "expiredDate";
    public static final String TAG_MEMBERBINDTIME = "memberBindTime";
    public static final String TAG_RIGHTSID = "rightsId";
    public static final String TAG_TERMINALTYPE = "terminalType";
    public static final String TAG_USERID = "userId";
    private long a;
    private int b;
    private String c;
    private String d;
    private String e;
    private int f;
    private String g;
    private String h;

    public static void a(XmlPullParser xmlPullParser, TmemberRight tmemberRight, String str) throws XmlPullParserException, IOException {
        if (xmlPullParser != null && tmemberRight != null && str != null) {
            if ("userId".equals(str)) {
                tmemberRight.a(Long.parseLong(xmlPullParser.nextText()));
            } else if ("deviceType".equals(str)) {
                try {
                    tmemberRight.a(Integer.parseInt(xmlPullParser.nextText()));
                } catch (Exception e) {
                    e.b("TmemberRight", "setDeviceType Exception", true);
                }
            } else if ("deviceId".equals(str)) {
                tmemberRight.a(xmlPullParser.nextText());
            } else if (TAG_DEVICEID2.equals(str)) {
                tmemberRight.b(xmlPullParser.nextText());
            } else if ("terminalType".equals(str)) {
                tmemberRight.c(xmlPullParser.nextText());
            } else if (TAG_RIGHTSID.equals(str)) {
                tmemberRight.d(xmlPullParser.nextText());
            } else if (TAG_MEMBERBINDTIME.equals(str)) {
                tmemberRight.e(xmlPullParser.nextText());
            } else if (TAG_EXPIREDDATE.equals(str)) {
                tmemberRight.f(xmlPullParser.nextText());
            } else {
                e.b("TmemberRight", "in getTmemberRightTag nodeName", true);
            }
        }
    }

    public void a(long j) {
        this.a = j;
    }

    public void a(int i) {
        this.b = i;
    }

    public void a(String str) {
        this.c = str;
    }

    public void b(String str) {
        this.d = this.c;
    }

    public void c(String str) {
        this.e = str;
    }

    public void d(String str) {
        try {
            this.f = Integer.parseInt(str);
        } catch (Exception e) {
            e.b("TmemberRight", "setRightsId except", true);
        }
    }

    public void e(String str) {
        this.g = str;
    }

    public void f(String str) {
        String str2 = "";
        try {
            str2 = b.a(str, "yyyy-MM-dd", "yyyyMMdd");
        } catch (Exception e) {
            e.c("TmemberRight", "changeTimeFormat Exception", true);
        }
        this.h = str2;
    }

    public int describeContents() {
        return 0;
    }

    public void writeToParcel(Parcel parcel, int i) {
        parcel.writeLong(this.a);
        parcel.writeInt(this.b);
        parcel.writeString(this.c);
        parcel.writeString(this.d);
        parcel.writeString(this.e);
        parcel.writeInt(this.f);
        parcel.writeString(this.g);
        parcel.writeString(this.h);
    }
}
